<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2.class</title>
    <style>
        .active {
            background-color: orangered;
            font-size: 20px;
            color: #fff;
        }

    </style>
</head>
<body>
<div id="app">
    <p v-for="(college,index) in colleges" :class="index === activeIndex ? 'active' : ''">
        {{college}}
    </p>
    <p style="color:red">今天的天气很好！</p>
    <p :style="{color:fontColor}">今天的天气很好！</p>
</div>
<script src=" https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            colleges: [
                'ios学院',
                'java学院',
                'html5学院',
                'ui学院',
                've学院'
            ],
            activeIndex: 0,
            fontColor: 'green',
        }
    });
</script>
</body>
</html>